<!DOCTYPE html>
<html lang="en">
<head>
    <title>tab 2</title>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="format-detection" content="telephone=no">

    <link rel="stylesheet" href="css/base.css">
    <style>
        body {
            /*background-color: burlywood;*/
        }
    </style>
    <script type="text/javascript" src="js/base.js"></script>
    <script type="text/javascript" src="js/dingtalk.js"></script>
    <script type="text/javascript">

        dd.ready(function() {
            document.addEventListener('resume', function() {
                log.i('resume');
            });
            document.addEventListener('pause', function() {
                log.i('pause');
            });
        });

        function config() {
            dd.ui.tab.config({
                id: 'tab_group',
                tabs: [
                    {
                        id: '2',
                        title: 'title2',
                        url: 'tab2.html'
                    },
                    {
                        id: '3',
                        title: 'title3',
                        url: 'tab3.html'
                    }

                ],

                onSuccess: function(data) {
                    log.i('tab config: ' + JSON.stringify(data));
                },
                onFail: function(err) {
                    log.e('tab config err: ' + JSON.stringify(err));
                }
            });
        }

        function select() {
            dd.ui.tab.select({
                groupId: 'tab_group',
                id:'3',

                onSuccess: function(data) {
                    log.i('tab config: ' + JSON.stringify(data));
                },
                onFail: function(err) {
                    log.e('tab config err: ' + JSON.stringify(err));
                }
            });
        }
    </script>
</head>
<body>
    <h1>tab 2</h1>

    <div><button onclick="config()">Config</button></div>
    <div><button onclick="select()">Select</button></div>

    <div class="clear-float"/>
    <div id="log"></div>
</body>
</html>